package cn.b.sky.mes.qm.dao;

import java.util.List;

import cn.b.sky.mes.qm.model.condition.InspectRecordCondition;
import org.apache.ibatis.annotations.Param;

import cn.b.sky.mes.cm.model.WorkCenter;
import cn.b.sky.mes.qm.model.DefectInspectRecord;
import cn.b.sky.mes.qm.model.DefectNode;
import cn.b.sky.mes.qm.model.DefectProcessOperation;
import cn.b.sky.mes.qm.model.DefectTopN;
import cn.b.sky.mes.qm.model.InspectRecord;
import cn.b.sky.mes.qm.model.InspectRecordAttachment;
import cn.b.sky.mes.qm.model.OperationDefectCount;
import cn.b.sky.mes.qm.model.UserDefect;

public interface InspectRecordDao {

  /**
   * 
   * <strong>Title : selectInspectRecordsByCondition<br></strong>
   * <strong>Description : </strong>分页查询检验过程<br> 
   * <strong>Create on : 2015-12-22 上午11:11:06<br></strong>
   * <p>
   * @param condition
   * @return
   * List<InspectRecord>
   * @throws 
   * @author lidapeng<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  List<InspectRecord> selectInspectRecordsByCondition(InspectRecordCondition condition);

  /**
   * 
   * <strong>Title : selectInspectRecordCountByCondition<br></strong>
   * <strong>Description : </strong>检验过程总数<br> 
   * <strong>Create on : 2015-12-22 上午11:11:27<br></strong>
   * <p>
   * @param condition
   * @return
   * int
   * @throws 
   * @author lidapeng<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  int selectInspectRecordCountByCondition(InspectRecordCondition condition);

  /**
   * 
   * <strong>Title : selectInspectRecordById<br></strong>
   * <strong>Description : </strong>通过id查询过程检验<br> 
   * <strong>Create on : 2015-12-22 上午11:11:42<br></strong>
   * <p>
   * @param id
   * @return
   * InspectRecord
   * @throws 
   * @author lidapeng<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  InspectRecord selectInspectRecordById(Long id);

  /**
   * 
   * <strong>Title : selectInspectRecordAttachmentsByInspectRecordId<br></strong>
   * <strong>Description : </strong>查询过程检验的附件<br> 
   * <strong>Create on : 2015-12-22 上午11:12:07<br></strong>
   * <p>
   * @param inspectRecordId
   * @return
   * List<InspectRecordAttachment>
   * @throws 
   * @author lidapeng<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  List<InspectRecordAttachment> selectInspectRecordAttachmentsByInspectRecordId(Long inspectRecordId);

  /**
   * 
   * <strong>Title : selectDefectNodeTreeWithColor<br></strong>
   * <strong>Description : </strong>查询带颜色缺陷树<br> 
   * <strong>Create on : 2015-12-22 上午11:18:54<br></strong>
   * <p>
   * @param siteCode
   * @return
   * List<DefectNode>
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  List<DefectNode> selectDefectNodeTreeWithColor(String siteCode);

  /**
   * 
   * <strong>Title : selectUserDefects<br></strong>
   * <strong>Description : </strong>查询缺陷收藏<br> 
   * <strong>Create on : 2015-12-22 下午01:22:19<br></strong>
   * <p>
   * @param siteCode
   * @param userCode
   * @return
   * List<UserDefect>
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  public List<UserDefect> selectUserDefects(@Param("siteCode") String siteCode, @Param("userCode") String userCode,
                                            @Param("operationCode") String operationCode, @Param("isOnlyPic") boolean isOnlyPic);

  /**
   * 
   * <strong>Title : insertUserDefect<br></strong>
   * <strong>Description : </strong>新增缺陷收藏<br> 
   * <strong>Create on : 2015-12-22 下午03:00:51<br></strong>
   * <p>
   * @param userDefect
   * void
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  public void insertUserDefect(UserDefect userDefect);

  /**
   * 
   * <strong>Title : deleteUserDefect<br></strong>
   * <strong>Description : </strong>删除缺陷收藏<br> 
   * <strong>Create on : 2015-12-22 下午03:01:03<br></strong>
   * <p>
   * @param userDefect
   * void
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  public void deleteUserDefect(UserDefect userDefect);

  /**
   * 
   * <strong>Title : selectUserDefect<br></strong>
   * <strong>Description : </strong>查询缺陷收藏<br> 
   * <strong>Create on : 2015-12-22 下午03:02:02<br></strong>
   * <p>
   * @param userDefect
   * @return
   * UserDefect
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  public UserDefect selectUserDefect(UserDefect userDefect);

  /**
   * 
   * <strong>Title : insertInspectRecord<br></strong>
   * <strong>Description : </strong>新增缺陷检验记录<br> 
   * <strong>Create on : 2015-12-23 下午05:57:51<br></strong>
   * <p>
   * @param inspectRecord
   * void
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  public void insertInspectRecord(InspectRecord inspectRecord);

  /**
   * 
   * <strong>Title : insertInspectRecordAttach<br></strong>
   * <strong>Description : </strong>新增缺陷检验附件<br> 
   * <strong>Create on : 2015-12-23 下午05:58:05<br></strong>
   * <p>
   * @param inspectRecordAttachment
   * void
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  public void insertInspectRecordAttach(InspectRecordAttachment inspectRecordAttachment);

  /**
   * 
   * <strong>Title : selectOperationDefectCount<br></strong>
   * <strong>Description : </strong>查询工序缺陷计数<br> 
   * <strong>Create on : 2015-12-23 下午07:52:55<br></strong>
   * <p>
   * @param operationDefectCount
   * @return
   * OperationDefectCount
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  public OperationDefectCount selectOperationDefectCount(OperationDefectCount operationDefectCount);

  /**
   * 
   * <strong>Title : insertOperationDefectCount<br></strong>
   * <strong>Description : </strong>新增工序缺陷计数<br> 
   * <strong>Create on : 2015-12-23 下午07:53:22<br></strong>
   * <p>
   * @param operationDefectCount
   * void
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  public void insertOperationDefectCount(OperationDefectCount operationDefectCount);

  /**
   * 
   * <strong>Title : updateOperationDefectCount<br></strong>
   * <strong>Description : </strong>更新工序缺陷计数<br> 
   * <strong>Create on : 2015-12-23 下午07:53:33<br></strong>
   * <p>
   * @param operationDefectCount
   * void
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  public void updateOperationDefectCount(OperationDefectCount operationDefectCount);

  /**
   * 
   * <strong>Title : selectDefectTopnData<br></strong>
   * <strong>Description : </strong>查询top N<br> 
   * <strong>Create on : 2015-12-22 上午11:12:23<br></strong>
   * <p>
   * @param condition
   * @return
   * List<DefectTopN>
   * @throws 
   * @author lidapeng<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  List<DefectTopN> selectDefectTopnData(InspectRecordCondition condition);

  /**
   * 
   * <strong>Title : selectDefectTotalData<br></strong>
   * <strong>Description : </strong>查询缺陷总数<br> 
   * <strong>Create on : 2015-12-22 上午11:12:41<br></strong>
   * <p>
   * @param condition
   * @return
   * int
   * @throws 
   * @author lidapeng<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  Integer selectDefectTotalData(InspectRecordCondition condition);

  List<DefectInspectRecord> selectDefectInspectRecords(DefectProcessOperation operation);

  /**
   * 
   * <strong>Title : selectAllPicDefects<br></strong>
   * <strong>Description : </strong>查询所有图形采集缺陷<br> 
   * <strong>Create on : 2015-12-25 下午01:53:38<br></strong>
   * <p>
   * @param siteCode
   * @param operationCode
   * @return
   * List<UserDefect>
   * @throws 
   * @author zhaoxin01<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  List<UserDefect> selectAllPicDefects(@Param("siteCode") String siteCode, @Param("operationCode") String operationCode);

  /**
   * 
   * <strong>Title : selectInspectRecordWorkCenters<br></strong>
   * <strong>Description : </strong>订单档案查询此订单下过程检验涉及到的工作中心<br> 
   * <strong>Create on : 2016-1-13 下午3:04:51<br></strong>
   * <p>
   * @param condition
   * @return
   * List<WorkCenter>
   * @throws 
   * @author lidapeng<br>
   * @version <strong>v1.0.0</strong><br>
   * <br>
   * <strong>修改历史:</strong><br>
   * 修改人 | 修改日期 | 修改描述<br>
   * -------------------------------------------<br>
   * <br>
   * <br>
   */
  List<WorkCenter> selectInspectRecordWorkCenters(InspectRecordCondition condition);
}
